package com.atlin.project.job.cycle;

import com.atlin.project.service.QuotationDataService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 从WeTab抓取数据到MySQL
 *
 * @author atlin
 */
@Slf4j
@Component
public class CaptureQuoteData {

    @Resource
    private QuotationDataService quotationDataService;


    // 一天执行三次
    @Scheduled(cron = "0 10 7,13,20 * * ?")
    public void run() {
        log.info("CaptureQuoteData start");
        quotationDataService.captureQuoteData();
        log.info("CaptureQuoteData end");
    }

}
